%option interactive
%{
#include <stdio.h>    

/* NEED TO "HOOK" PARSER TO LEXER */
// parens.tab.h contains the token number values produced by the parser
#include "prefix_both.tab.h"
%}

digit     [0-9]

%%
[ \t]+ {}
\n  {return NEWLINE;}
"+" { return PLUS;}
"-" { return MINUS;}
"/" { return DIVIDE;}
"*" { return TIMES;}
{digit}+"."{digit}*|{digit}+ { 
      yylval.val = atof(yytext);
      return NUM;
}

. {fprintf(stderr, "syntax error\n");}

%%
//nothing - .y file drives
